<?php 
include("includes/code_admin.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title><?php echo SITEURL; ?> Administrator</title>
<link href="style_admin.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div id="container">
<table class="main" cellspacing="0" cellpadding="0">
  <tr>
    <td class="header">
    <!-- header start -->
    <?php include("includes/header.php");?>
    <!-- header finish -->
    </td>
  </tr>
  <tr>
    <td class="middle">&nbsp;</td>
  </tr>
  <tr>
    <td>
    <!-- tepa start -->
<?php include("includes/tepa.php"); ?>
    <!-- tepa finish -->
    </td>
  </tr>
  <tr>
    <td>
    <!-- contant start -->
<table class="content" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td>

<!-- right col -->
<div class="right_col">
<h3 class="title">Login va Parol</h3>

<?php 
if(isset($_POST['send']))
{
	$name = trim($_POST['name']);
	$parol = trim($_POST['parol']);
	
	$natija = mysql_query("UPDATE login SET name='$name', parol='$parol' WHERE id='1'");
	if($natija=='true') 
	{
	echo "<p class='ok'>Login va parol o'zgardi, OK</p> <br><center><a href='index.php'><b>Bosh sahifaga qaytish </b></a></center>";
	}
	else 
	{
	echo "<p class='error'>Afsuski login va parol o'zgarmadi, Adminga xabar qiling</p>"; 
	}

}

if(!isset($_POST['send']))
{
$result = mysql_query("SELECT name,parol FROM login");
$myrow = mysql_fetch_array($result);
?>
<fieldset>
<legend style="color:#456F98">Parol va Loginni o'zgaritirish</legend>
<form name="myform" action="" method="post">
<table width="500" border="0" cellspacing="10" cellpadding="0">
  <tr>
    <td width="80"  class="r">Login:</td>
    <td><input name="name" type="text" size="40" maxlength="40" value="<? echo $myrow["name"]; ?>"/></td>
  </tr>
  <tr>
    <td class="r">Parol:</td>
    <td><input name="parol" type="text" size="40" maxlength="40" value="<? echo $myrow["parol"]; ?>"/></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="send" value=" Saqlash " /> </td>
  </tr>
</table>
</form>

<?php 
}
?>
</fieldset>
</div>
	<!-- right col finish -->
    </td>
  </tr>
</table>


    <!-- contant finish -->
    </td>
  </tr>
</table>
<!-- futer start -->
<?php include("includes/futer.php"); ?>
<!-- futer finish -->
</div>
</body>
</html>
